<?php

// @author 3ogx <3ogx.com@gmail.com>

namespace Jushuitan\Console;

use Illuminate\Console\Command;

class RefreshTokenCommand extends Command
{
    protected $signature = 'jst:refresh';

    protected $description = '刷新 token';

    public function handle(): void
    {
        $config = config('jst');
        $data   = [
            'app_key'       => $config['app_key'],
            'refresh_token' => $config['refresh_token'],
        ];
        $data = Factory::RefreshToken($data)->send();
        $this->info('刷新 token 成功！' . sprintf('请求信息：%s, 编码： %s', $data['msg'], $data['code']));
    }
}
